namespace AdminSG3L.Domain.Entities;

/// <summary>
/// 管理系统配置实体
/// </summary>
public class AdminSystem : EntityBase
{
    /// <summary>
    /// 配置键，必填
    /// </summary>
    public string SystemKey { get; private set; }
    /// <summary>
    /// 配置值，必填
    /// </summary>
    public string SystemValue { get; private set; }
    /// <summary>
    /// 配置描述，必填
    /// </summary>
    public string SystemDescription { get; private set; }

    /// <summary>
    /// 私有构造函数，仅限工厂方法调用
    /// </summary>
    private AdminSystem(string systemKey, string systemValue, string systemDescription)
    {
        SystemKey = systemKey;
        SystemValue = systemValue;
        SystemDescription = systemDescription;
    }

    /// <summary>
    /// 创建AdminSystem对象的工厂方法
    /// </summary>
    /// <param name="systemKey">配置键</param>
    /// <param name="systemValue">配置值</param>
    /// <param name="systemDescription">配置描述</param>
    /// <param name="description">描述</param>
    /// <returns>AdminSystem对象</returns>
    public static AdminSystem Create(string systemKey, string systemValue, string systemDescription, string? description = null)
    {
        return new AdminSystem(systemKey, systemValue, systemDescription)
        {
            Description = description
        };
    }
}